<%@page import="model.Comment"%>
<%@ page import="model.User" %>
<%@page import="dao.DAOFactory"%>
<%@page import="dao.DAO"%>
<%@page import="java.util.List"%>
<%@page import="java.util.Iterator"%>

<%
	DAO<User> categoryDAO = DAOFactory.getUserDAO();

	@SuppressWarnings("unchecked")
	List<Comment> commentList = (List<Comment>) request.getAttribute("commentListPP");
	if (commentList != null){
	Iterator<Comment> i = commentList.iterator();
	
	while(i.hasNext()) {
			Comment comment = i.next();
			User aUser = new User();
			aUser = categoryDAO.findById(comment.getUser_id());
			%>
				<table>
					<tr>
						<td valign="top"><label class="login"><%= aUser.getLogin()%></label></td>
						<td>
							<p class="titleComment"><%=comment.getTitle()%></p>
							<p class="textComment"><%=comment.getText()%></p>
						</td>
					</tr>
				</table>
			<%
		}
	}
	
%>
